package com.maila.xiaoaoschool.activity;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.EditText;
import android.widget.ListView;
import android.widget.TextView;

import com.cjj.MaterialRefreshLayout;
import com.maila.xiaoaoschool.R;
import com.maila.xiaoaoschool.util.NullPointUtils;
import com.maila.xiaoaoschool.util.StartActivityUtils;
import com.zhy.autolayout.AutoLinearLayout;
import com.zhy.autolayout.AutoRelativeLayout;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by Administrator on 2017/10/31.
 */

public class SearchActivity extends AppCompatActivity {
    @BindView(R.id.white_return_iv)
    AutoRelativeLayout whiteReturnIv;
    @BindView(R.id.et_search)
    EditText etSearch;
    @BindView(R.id.search_information_tv)
    TextView searchInformationTv;
    @BindView(R.id.ll_title)
    AutoLinearLayout llTitle;
    @BindView(R.id.lv_fujin)
    ListView lvFujin;
    @BindView(R.id.hot_refresh)
    MaterialRefreshLayout hotRefresh;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_search);
        ButterKnife.bind(this);
    }

    @OnClick({R.id.white_return_iv, R.id.et_search})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.white_return_iv:
                finish();
                break;
            case R.id.et_search:
                if(NullPointUtils.checknull(etSearch.getText().toString())){
                    StartActivityUtils.startByOpt(this,SearchShopActivity.class,1,etSearch.getText().toString());
                    finish();
                }

                break;
        }
    }
}
